package com.hzjh.base.ext.widget.balloon

import android.content.Context
import androidx.lifecycle.LifecycleOwner
import com.hzjh.base.ext.R
import com.skydoves.balloon.ArrowOrientation
import com.skydoves.balloon.ArrowPositionRules
import com.skydoves.balloon.Balloon
import com.skydoves.balloon.createBalloon

class CommonTipBalloon2 : Balloon.Factory() {
    override fun create(context: Context, lifecycle: LifecycleOwner?): Balloon {

        return createBalloon(context) {
            setLayout(R.layout.layout_ballon_generate_tip)
            setArrowOrientation(ArrowOrientation.TOP)
            setArrowPositionRules(ArrowPositionRules.ALIGN_BALLOON)
            setArrowPosition(0.15f)
            setArrowWidth(20)
            setArrowHeight(10)
            setCornerRadius(8f)
//            setMarginRight(12)
//            setMarginLeft(12)
//            setWidth(screenWidth)
            setBackgroundColorResource(com.hzjh.base.style.R.color.coreWhite)
            setDimBehind(0.2f)
            setDismissWhenShowAgain(true)
            setLifecycleOwner(lifecycle)
            build()
        }
    }
}